home *** CD-ROM | disk | FTP | other *** search
/ BMUG PD-ROM A / PD-ROM A.iso / Programming / Programming Languages / MacOberon / MacOberon (tools) / Write.Guide.Txt (.txt) < prev    next >
Encoding:
Oberon Text  |  1991-02-06  |  17.3 KB  |  142 lines  |  [.Ob./.Ob2]

  1. Syntax10.Scn.Fnt
  2. Syntax14m.Scn.Fnt
  3. Syntax12m.Scn.Fnt
  4. Syntax10b.Scn.Fnt
  5. Syntax10i.Scn.Fnt
  6. Syntax8.Scn.Fnt
  7. Guide to Write
  8. 1.02  (9 Jan 91)
  9. C. Szyperski
  10. Tutorial and Release Notes
  11. Introduction
  12. Write is an extensible text editor for the Oberon system. It is based on a few simple concepts and aims at typical writing tasks, such as memos and reports. It does not try to support a document model, and it is not fully "wysiwyg". To arrive at a rather simple implementation, the few concepts provided have been carried out with all consequences. This should be kept in mind before considering a certain behaviour of the editor to be a "bug". The following tutorial assumes that the reader already knows how to use the Oberon system, especially, how to handle viewers, files, and commands.
  13. Principles
  14. A Write text models a sequence of characters. Besides standard characters, Write supports special user extensible characters. Such characters, called elements, float in the text just as ordinary characters do. Typical elements support the integration of graphics and the like into texts. A standard extension of elements allows for separating the text into paragraphs. Such elements are called paragraph controls or parc for short. A parc defines the paragraph attributes for all characters following it up to the next parc or the end of the text.
  15.     Mouse commands are interpreted by Write just as defined by Edit. Exceptions to that occur when clicking on an element. Here, the element is free to consume (and act on) the mouse click, overriding the standard behaviour. This is used by parcs to support interactive setting of paragraph attributes.
  16.     Insertion of new characters into the text requires setting the caret left to the character before which to insert, or to the end of the text. Selecting a stretch of the text corresponds to selecting a range of characters. The visible selection extends from the beginning of the first selected character to the beginning of the first character behind the selection or the end of the text. Hence, selections always reflect the exact area which is affected when changing or deleting.
  17. Editing
  18. Basic editing functionality is just as in Edit. This includes scrolling, setting the caret, selecting text, inserting, copying, and deleting text stretches, and changing attributes of characters. The cursor left/right keys move the caret. To support editing indented text (like programs), the Linefeed key can be used instead of Carriage-Return. This will indent the next line to the same level as the previous one. The cursor left/right keys will shift indented text if it is selected in the focus viewer with the caret invisible. Furthermore, when extending a selection over two consecutive viewers, Write adds visual feedback. This avoids the danger of extending a selection by mistake and then deleting or copying a far larger stretch of text than was intended. See below for a description of commands that further support basic editing.
  19.     In order to insert a parc into a text, place the caret at the appropriate position and press BREAK. This will copy the parc above the caret position (or the default parc if there is none above). A parc is displayed as a separation line corresponding to the width set for that paragraph. Above that separation line, one or two marks signal the formatting mode of the paragraph: a single mark at the very left, in the middle, or at the very right indicates left flush, centered, or right flush formatting, respectively. Two marks at both ends indicate block (fully justified) formatting. Below the separation line, set tabs are indicated by marks. Pressing Shift-BREAK inserts a parc which forces a page break (attribute break=before). Such parcs are displayed using a solid separation line.
  20.     A parc defines a special behaviour for middle-button mouse clicks. It has two separate sensitive areas. One above and one below the separation line. The following table shows how various middle mouse button clicks and interclicks affect the paragraph attributes bound to a parc. Again, see the commands below for further manipulations of parcs.
  21. where    buttons    effect
  22. above separation line, left end    middle    inset left margin
  23. above separation line, left end    middle + right    symmetric inset of left & right margin
  24. above separation line, right end    middle    inset right margin
  25. above separation line, right end    middle + right    symmetric inset of left & right margin
  26. above separation line, towards left end    middle    left flush formatting
  27. above separation line, in the middle    middle    centered formatting
  28. above separation line, towards right end    middle    right flush formatting
  29. above separation line    middle + left    block formatting
  30. below separation line, no tab mark hit    middle    create new tab
  31. below separation line, tab mark hit    middle    move tab
  32. below separation line, tab mark hit    middle + right    move tab and all subsequent tabs in synch
  33. below separation line, tab mark hit    middle + left    delete tab
  34. Printing
  35. When printing a text, Write reformats individual paragraphs for the printer. Write preserves all user setable measures, while individual words may be placed differently. This allows for optimal display of texts on the screen, while at the same time fully exploiting the printer resolution. Hence, it should not be tried to affect the placing of individual words by inserting additional blanks or the like! Furthermore, Write ignores all empty space at the beginning of a page except when preceded by a parc with enforced page break attribute. White space in this sense are empty lines (a single blank makes a line non-empty!) and lead-space defined by a parc. Refer to the print command description below for details on how to initiate a printout.
  36.     In order to achieve good results, the Lm3 metrics files for the used font families should be available. For example, when using the fonts Syntax12, Math12, Syntax14, and LetterHead, the metrics files Syntax.Lm3.Fnt, Math.Lm3.Fnt, and LetterHead.Lm3.Fnt are required. If a metrics file for a used font is missing, the printer metrics are estimated using a simple heuristics based on the screen font metrics. Beware: this leads to at most draft quality of the printed text.
  37. Commands in the Viewer Menu
  38. Write.Search
  39.     Takes the most recent selection as search argument. If the selection is older than the latest one used for Write.Search, the previously set search argument will be used. Write.Search starts searching at the current caret position, or at the beginning of the text, if no caret is set. When starting the search behind the last occurence of the search pattern, the search will automatically wrap around and start over again at the beginning of the text.
  40. Write.Replace
  41.     Takes the most recent selection as replacement argument. If the selection is older than the latest one used for Write.Replace, the previously set replacement argument will be used. Write.Replace verifies that the pattern right to the current caret position matches the current search argument. If so, it is replaced and Write.Replace automatically searches for the next occurence. Write.Replace does not wrap around when searching.
  42. Write.ReplaceAll
  43.     To make Write.ReplaceAll usable, the separating space in the menu has to be deleted. Write.ReplaceAll operates much the same way as Write.Replace does. Additionally, the replacing process is carried on to the end of the text. Write.ReplaceAll does not wrap around when searching.
  44. Write.Store
  45.     Stores the text. After completing, Write.Store writes out the number of characters in the text. Whenever the text displayed in a Write viewer has been changed but not yet stored, the menu bar contains an exclamation mark following the Write.Store command.
  46. Commands in the Write Tool
  47. The following commands are supported by Write. Generally, the standard Write tool contains several examples on how to use the Write commands, most of which should be self-explaining. For each command, the parameters directly following the command are given. Furthermore, most of the commands take further implicit parameters, like the current selection, the current focus (the caret), and the selection in the currently marked viewer. Such parameters are also listed below. Whenever the marked viewer (or the selection in its body frame) is taken as a parameter, the viewer is expected to display a Write text. The selection symbol "^" adds a level of indirection by taking the explicit parameters of the command from the current selection. Explicit parameters may be names (sequences of characters starting with a letter, followed by letters, digits, or periods), strings (sequence of characters enclosed by quotes), or numbers (sequences of characters starting with a minus or a digit, followed by digits).
  48. command    explicit parameters    implicit parameters
  49. Write.Open    ("^" | name)
  50. Opens a Write viewer displaying the named text.
  51. Write.SysOpen    ("^" | name)
  52. Opens a Write viewer in the system track displaying the named text. The default formatting uses a reduced width and a regular tabulator setting every 5mm.
  53. Write.Store    name    marked viewer
  54. Takes the text displayed in the marked viewer and stores it under the given name. The total number of bytes taken by the created file is written to the log.
  55. Write.Print    server-name ("^" | "*" {option} | {name {option}} "~")
  56. Prints a list of Write texts. The print options are explained in a separate table below. Unless specified otherwise (using the /p option), Write.Print will assign consecutive page numbers to all texts printed with a single print command. As feedback, Write.Print writes the name and the number of copies of each printed text to the system log. Also, a period is written to the log for each page sent to the printer.
  57. Write.Recall        caret
  58. Inserts the most recently deleted text stretch at the current caret position. Write.Recall can be used repeatedly to insert a deleted portion at several places. (Edit.Recall does nothing when applied to a Write text.)
  59. Write.InsertParc        caret
  60. Inserts a new default parc at the current caret position.
  61. Write.Locate    ("^" | number)    marked viewer
  62. Locates a character position and makes it visible in the marked viewer. (Do not use Edit.Locate to locate a position in a Write text!)
  63. Write.SelectParc        caret
  64. Make visible the parc corresponding to the paragraph containing the caret and select it.
  65. Write.ChangeFont    ("^" | name)    selection in marked viewer
  66. Change the font attribute of the selected characters in the marked viewer.
  67. Write.ChangeColor    ("^" | number)    selection in marked viewer
  68. Change the color attribute of the selected characters in the marked viewer. (Has no visible effect on monochrome monitors, on color monitors; 0 is the background and 15 the foreground color.)
  69. Write.ChangeOffset    ("^" | number)    selection in marked viewer
  70. Change the vertical offset attribute of the selected characters in the marked viewer (-128..127). The offset is specified in 1/64th of the font height of the affected character.
  71. Write.Set    ("^" | {attribute-name [values]})    selected parc in marked viewer
  72. Sets paragraph attributes bound to the selected parc. The paragraph attributes are explained in a separate table below.
  73. Write.Get    ("^" | attribute-name)    selected parc in marked viewer
  74. Gets paragraph attributes bound to the selected parc. The paragraph attributes are the same as for Write.Set. If no special paragraph attribute is selected, all attributes will be shown.
  75. Write.MakeDefault        selected parc in marked viewer
  76. Sets the default formatting of the marked text to the attributes of the selected parc.
  77. Write.ShowAliens        marked viewer
  78. Searches the marked text for undefined elements. Such elements occur, if a text is opened while some defining modules of extended elements are not available. Write displays undefined elements uniformly as an empty frame. Write.ShowAliens list the position of such elements, as well as the names of the missing modules. Note that undefined elements can be selected, copied and deleted freely. As soon as the missing module become available, it is sufficient to reopen affected texts and the elements will again behave as originally intended.
  79. Print Options
  80. option    function
  81. "/a"    alternating pages - different page formatting for even and odd page numbers
  82. "/c" number    request a certain number of copies to be printed (1..9)
  83. "/f" name    select font other than the system default font for headers and page numbers
  84. "/h"    request a header (file name plus print date) on each page
  85. "/l" number    add horicontal offset (in 1/10 mm) to page image
  86. "/p" number    start page numbering at a certain number (otherwise it starts at 0)
  87. "/p" "f"    suppress page number on first page
  88. "/p" "n"    suprress page numbers
  89. "/s" number [number]    select page(s) to print (the numbering corresponds to the one set by /p)
  90. Paragraph Attributes
  91. All numerical values are to be specified in 1/10 mm units (e.g. the value 150 corresponds to 1.5 cm).
  92. attribute    value(s)    default    function
  93. "adjust"    block | center | left | right    left    formatting mode
  94. "break"    before | normal    normal    if before, force page break immediately before parc
  95. "grid"    on | off    off    line grid
  96. "lead"    name | number | "default"    0    leading paragraph space (name specifies model font)
  97. "left"    number | "default"    0    left margin
  98. "line"    name | number | "default"    34 (Syntax10)    minimal line height (name specifies model font)
  99. "tabs"    ("*" number | {number} "~")    ~    tab spacing (every n, or enumerated)
  100. "width"    number | "default"    1650    maximal line width
  101. The line spacing model assumes a minimal line height for each paragraph. If a line exceeds its minimal line height, it is automatically adjusted to avoid clutter between it and the line above it. If the line grid is turned on for that paragraph (default), the line is adjusted to an integer multiple of the minimal line height.
  102.     Advise: In order to reach a typographically sound layout, in most cases a single line height should be selected for all paragraphs of the text. To get good results when combining a font for body text with larger ones for titles and section headings and smaller ones for captions, it is useful to set the line height to the body font and turn the line grid on. In most cases, it is preferable to set line height and paragraph leadings using the name of the predominant font ("model font").
  103. Write Tools
  104. A collection of utility commands most of which operate equally well on standard texts and Write texts. (The application to Leda texts is not recommended - the standard Leda Attributes Viewer should be used in conjunction with Leda.Search and Leda.Replace.)
  105. command    explicit parameters    implicit parameters
  106. WriteTools.GetAttr        selected character
  107. Get textual attributes of the selected character: ASCII code, font name, color, and vertical offset.
  108. WriteTools.IncSize    ("^" | number)    selection
  109. Increment font sizes in selected range (negative increments may be used to decrement sizes). If a computed font is not available, the old font is retained.
  110. WriteTools.ChangeSize    ("^" | {number "=>" number} "~")    selection
  111. Change font sizes absolutely within the selected range. If a computed font is not available, the old font is retained.
  112. WriteTools.ChangeFamily    ("^" | {name "=>" name} "~")    selection
  113. Change font families within the selected range. If a computed font is not available, the old font is retained.
  114. WriteTools.Change    ("^" | {name "=>" name} "~")    selection
  115. Change fonts within the selected range. If a font is not available, the old font is retained.
  116. WriteTools.Words    ("^" | {name} "~")
  117. Counts characters and words in the listed files.
  118. WriteTools.Cleanup    ("^" | {name} "~")
  119. Scans a Write text and removes alien and ill-sized elements. (Restricted in use to Write texts.)
  120. Elements
  121. For a documentation of existing Write elements, cf. Elem.Guide.Txt - For a tutorial on how to design and implement Write elements, cf. WriteElems.Guide.Txt.
  122. cas 9 Jan 91
  123. WriteParcs.Alloc
  124. WriteParcs.Alloc
  125. WriteParcs.Alloc
  126. WriteParcs.Alloc
  127. WriteParcs.Alloc
  128. WriteParcs.Alloc
  129. WriteParcs.Alloc
  130. WriteParcs.Alloc
  131. WriteParcs.Alloc
  132. WriteParcs.Alloc
  133. WriteParcs.Alloc
  134. WriteParcs.Alloc
  135. WriteParcs.Alloc
  136. WriteParcs.Alloc
  137. WriteParcs.Alloc
  138. WriteParcs.Alloc
  139. WriteParcs.Alloc
  140. WriteParcs.Alloc
  141. WriteParcs.Alloc
  142.